﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using StockTrader.DAL.IDAL;
using StockTrader.DAL.MSSQLHelper;
using StockTrader.BusinessService.DataContract;

namespace StockTrader.DAL.SQLserver
{
    public class HoseOrder
    {
        private SqlConnection _internalConnection;
        private SqlTransaction _internalADOTransaction = null;

        public void BeginADOTransaction()
        {
            if (_internalConnection.State != System.Data.ConnectionState.Open)
                _internalConnection.Open();
            _internalADOTransaction = _internalConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
        }
        public void RollBackTransaction()
        {
            _internalADOTransaction.Rollback();
            _internalADOTransaction = null;
        }
        public void CommitADOTransaction()
        {
            _internalADOTransaction.Commit();
            _internalADOTransaction = null;
        }
        public void Open(string connString)
        {
            if (_internalConnection == null)
                _internalConnection = new SqlConnection(connString);
            if (_internalConnection.State != ConnectionState.Open)
                _internalConnection.Open();
        }
        public void Close()
        {
            if (_internalConnection != null && _internalConnection.State != System.Data.ConnectionState.Closed)
                _internalConnection.Close();
        }

        //SQL string

        #region Parameters
        private const string PARM_REPLYCODE = "@REPLYCODE";
        private const string PARM_TIMESTAMP = "@TIMESTAMP";
        private const string PARM_MESSAGETYPE = "@MESSAGETYPE";
        private const string PARM_FIRM = "@FIRM";
        private const string PARM_TRADEID = "@TRADEID";
        private const string PARM_ORDERNUMBER = "@ORDERNUMBER";
        private const string PARM_CLIENTID = "@CLIENTID";
        private const string PARM_VOLUME = "@VOLUME";
        private const string PARM_PUBLISHEDVOLUME = "@PUBLISHEDVOLUME";
        private const string PARM_BOARD = "@BOARD";
        private const string PARM_DEALID = "@DEALID";
        private const string PARM_FILTER = "@FILTER";
        private const string PARM_FILTER1 = "@FILTER1";
        private const string PARM_FILTER2 = "@FILTER2";
        private const string PARM_FILTER3 = "@FILTER3";
        private const string PARM_PORTCLIENTFLAG = "@PORTCLIENTFLAG";
        private const string PARM_ORDERENTRYDATE = "@ORDERENTRYDATE";
        private const string PARM_OFFSET = "@OFFSET";
        private const string PARM_SIDE = "@SIDE";
        private const string PARM_ADDCANCELFLAG = "@ADDCANCELFLAG";
        private const string PARM_CONTACT = "@CONTACT";
        private const string PARM_TIME = "@TIME";
        private const string PARM_CANCELSHARES = "@CANCELSHARES";
        private const string PARM_ORDERCANCELSTATUS = "@ORDERCANCELSTATUS";
        private const string PARM_CLIENTIDBUYER = "@CLIENTIDBUYER";
        private const string PARM_CLIENTIDSELLER = "@CLIENTIDSELLER";
        private const string PARM_BROKERPORTFOLIOVOLBUYER = "@BROKERPORTFOLIOVOLBUYER";
        private const string PARM_BROKERCLIENTVOLBUYER = "@BROKERCLIENTVOLBUYER";
        private const string PARM_MUTUALFUNDVOLBUYER = "@MUTUALFUNDVOLBUYER";
        private const string PARM_BROKERFOREIGNVOLBUYER = "@BROKERFOREIGNVOLBUYER";
        private const string PARM_BROKERPORTFOLIOVOLSELLER = "@BROKERPORTFOLIOVOLSELLER";
        private const string PARM_BROKERCLIENTVOLSELLER = "@BROKERCLIENTVOLSELLER";
        private const string PARM_MUTUALFUNDVOLSELLER = "@MUTUALFUNDVOLSELLER";
        private const string PARM_BROKERFOREIGNVOLSELLER = "@BROKERFOREIGNVOLSELLER";
        private const string PARM_CONTRAFIRMBUYER = "@CONTRAFIRMBUYER";
        private const string PARM_CONTRAFIRMSELLER = "@CONTRAFIRMSELLER";
        private const string PARM_CONTRAFIRM = "@CONTRAFIRM";
        private const string PARM_TRADEIDBUYER = "@TRADEIDBUYER";
        private const string PARM_TRADEIDSELLER = "@TRADEIDSELLER";
        private const string PARM_CONFIRMNUMBER = "@CONFIRMNUMBER";
        private const string PARM_FIRMBUYER = "@FIRMBUYER";
        private const string PARM_REJECTREASONCODE = "@REJECTREASONCODE";
        private const string PARM_MESSAGETEXT = "@MESSAGETEXT";
        private const string PARM_ORDERNUMBERBUYER = "@ORDERNUMBERBUYER";
        private const string PARM_ORDERNUMBERSELLER = "@ORDERNUMBERSELLER";
        private const string PARM_ORDERENTRYDATEBUYER = "@ORDERENTRYDATEBUYER";
        private const string PARM_ORDERENTRYDATESELLER = "@ORDERENTRYDATESELLER";


        private const string PARM_ORDERNO = "@ORDERNO";
        private const string PARM_NEXTORDERID = "@NEXTORDERID";
        private const string PARM_ACCOUNTID = "@ACCOUNTID";
        private const string PARM_MEMBERID = "@MEMBERID";
        private const string PARM_BROKERID = "@BROKERID";
        private const string PARM_OPENDATE = "@OPENDATE";
        private const string PARM_GTD = "@GTD";
        private const string PARM_COMLETIONDATE = "@COMPLETIONDATE";
        private const string PARM_ORDERTYPE = "@ORDERTYPE";
        private const string PARM_ORDERSIDE = "@ORDERSIDE";
        private const string PARM_ORDERCLASS = "@ORDERCLASS";
        private const string PARM_ORDERMODE = "@ORDERMODE";
        private const string PARM_ORDERSTATUS = "@ORDERSTATUS";
        private const string PARM_PRIORITY = "@PRIORITY";
        private const string PARM_SYMBOL = "@SECURITYSYMBOL";
        private const string PARM_PRICE = "@PRICE";
        private const string PARM_QUANTITY = "@QUANTITY";
        private const string PARM_ORDERFEE = "@ORDERFEE";
        private const string PARM_MATCHQTTY = "@MATCHQTTY";
        private const string PARM_CANCELLQTTY = "@CANCELLQTTY";
        private const string PARM_REMAINQTTY = "@REMAINQTTY";
        private const string PARM_QUOTEPRICE = "@QUOTEPRICE";
        private const string PARM_REJECTREASON = "@REJECTREASON";
        private const string PARM_PHONE = "@PHONE";
        private const string PARM_SESSIONNO = "@SESSIONNO";
        private const string PARM_SETTLMENTDATE = "@SETTLEMENTDATE";
        private const string PARM_SETTMENTTYPE = "@SETTLEMENTTYPE";
        private const string PARM_HOLDINGID = "@HOLDINGID";
        #endregion

        //Functions

        #region Insert IOrder Members


        public void InsertAdvertisement(string timestamp, string messagetype, string firm, string tradeid, string symbol, string side, long volume, string price, string board, string addcancelflag, string contact, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_TRADEID, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_SYMBOL, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_SIDE, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_VOLUME, SqlDbType.BigInt),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar,12),
                                                new SqlParameter(PARM_BOARD, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_TIME, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_ADDCANCELFLAG, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_CONTACT, SqlDbType.VarChar,20),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = tradeid;
                parms[4].Value = symbol;
                parms[5].Value = side;
                parms[6].Value = volume;
                parms[7].Value = price;
                parms[8].Value = board;
                parms[9].Value = timestamp;
                parms[10].Value = addcancelflag;
                parms[11].Value = contact;
                parms[12].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertAdvertisement", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertConfirmOrderCancel(string timestamp, string messagetype, string firm, long cancelshare, string ordernumber, string orderEntryDate, string orderCancelStatus, int orderOffset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_CANCELSHARES, SqlDbType.BigInt),
                                                new SqlParameter(PARM_ORDERNUMBER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_ORDERENTRYDATE, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_ORDERCANCELSTATUS, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = cancelshare;
                parms[4].Value = ordernumber;
                parms[5].Value = orderEntryDate;
                parms[6].Value = orderCancelStatus;
                parms[7].Value = orderOffset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertConfirmOrderCancel", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertOrderCancellation(string timestamp, string messagetype, string firm, string ordernumber, string orderentrydate, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_ORDERNUMBER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_ORDERENTRYDATE, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = ordernumber;
                parms[4].Value = orderentrydate;
                parms[5].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertOrderCancellation", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertOrderChange(string timestamp, string messagetype, string firm, string ordernumber, string orderentrydate, string clientid, string filter, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_ORDERNUMBER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_ORDERENTRYDATE, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_CLIENTID, SqlDbType.VarChar,10),
                                                new SqlParameter(PARM_FILTER, SqlDbType.VarChar, 17),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = ordernumber;
                parms[4].Value = orderentrydate;
                parms[5].Value = clientid;
                parms[6].Value = filter;
                parms[7].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertOrderChange", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertOneFirmPutThroughDeal(string timestamp, string messagetype, string firm, string tradeid, string clientIdBuyer, string ClientIdSeller, string symbol, string price, string board, string dealid, string filter1, long brokerPortfolioVolBuyer, long brokerClientVolBuyer, long mutualFundVolBuyer, long brokerForeignVolBuyer, string filter2, long brokerPortfolioVolSeller, long brokerClientVolSeller, long mutualFundVolSeller, long brokerForeignVolSeller, string filter3, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_TRADEID, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_CLIENTIDBUYER, SqlDbType.VarChar,10),
                                                new SqlParameter(PARM_CLIENTIDSELLER, SqlDbType.VarChar,10),
                                                new SqlParameter(PARM_SYMBOL, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar, 12),
                                                new SqlParameter(PARM_BOARD, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_DEALID, SqlDbType.VarChar,5),
                                                new SqlParameter(PARM_FILTER1, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_BROKERPORTFOLIOVOLBUYER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_BROKERCLIENTVOLBUYER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_MUTUALFUNDVOLBUYER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_BROKERFOREIGNVOLBUYER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_FILTER2, SqlDbType.VarChar,32),
                                                new SqlParameter(PARM_BROKERPORTFOLIOVOLSELLER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_BROKERCLIENTVOLSELLER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_MUTUALFUNDVOLSELLER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_BROKERFOREIGNVOLSELLER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_FILTER3, SqlDbType.VarChar,32),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = tradeid;
                parms[4].Value = clientIdBuyer;
                parms[5].Value = ClientIdSeller;
                parms[6].Value = symbol;
                parms[7].Value = price;
                parms[8].Value = board;
                parms[9].Value = dealid;
                parms[10].Value = filter1;
                parms[11].Value = brokerPortfolioVolBuyer;
                parms[12].Value = brokerClientVolBuyer;
                parms[13].Value = mutualFundVolBuyer;
                parms[14].Value = brokerForeignVolBuyer;
                parms[15].Value = filter2;
                parms[16].Value = brokerPortfolioVolSeller;
                parms[17].Value = brokerClientVolSeller;
                parms[18].Value = mutualFundVolSeller;
                parms[19].Value = brokerForeignVolSeller;
                parms[20].Value = filter3;
                parms[21].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertOneFirmPutThroughDeal", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertTwoFirmPutThroughDeal(string timestamp, string messagetype, string firmSeller, string tradeIDSeller, string ClientIdSeller, string contraFirmBuyer, string tradeIDBuyer, string symbol, string price, string board, string dealid, string filter1, long brokerPortfolioVolSeller, long brokerClientVolSeller, long mutualFundVolSeller, long brokerForeignVolSeller, string filter2, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRMBUYER, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_TRADEIDSELLER, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_CLIENTIDSELLER, SqlDbType.VarChar,10),
                                                new SqlParameter(PARM_CONTRAFIRMBUYER, SqlDbType.VarChar,2),
                                                
                                                new SqlParameter(PARM_TRADEIDBUYER, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_SYMBOL, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar, 12),
                                                new SqlParameter(PARM_BOARD, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_DEALID, SqlDbType.VarChar,5),
                                                new SqlParameter(PARM_FILTER1, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_BROKERPORTFOLIOVOLSELLER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_BROKERCLIENTVOLSELLER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_MUTUALFUNDVOLSELLER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_BROKERFOREIGNVOLSELLER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_FILTER2, SqlDbType.VarChar,32),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firmSeller;
                parms[3].Value = tradeIDSeller;
                parms[4].Value = ClientIdSeller;
                parms[5].Value = contraFirmBuyer;
                parms[6].Value = tradeIDBuyer;
                parms[7].Value = symbol;
                parms[8].Value = price;
                parms[9].Value = board;
                parms[10].Value = dealid;
                parms[11].Value = filter1;
                parms[12].Value = brokerPortfolioVolSeller;
                parms[13].Value = brokerClientVolSeller;
                parms[14].Value = mutualFundVolSeller;
                parms[15].Value = brokerForeignVolSeller;
                parms[16].Value = filter2;
                parms[17].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertTwoFirmPutThroughDeal", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertNewConditionedOrder(string timestamp, string messagetype, string firm, string tradeId, string orderNumber, string clientId, string symbol, string side, long volume, long publishedVolume, string price, string board, string filter, string portClientFlag, string filter2, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_TRADEID, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_ORDERNUMBER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_CLIENTID, SqlDbType.VarChar,10),
                                                new SqlParameter(PARM_SYMBOL, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_SIDE, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_VOLUME, SqlDbType.BigInt),
                                                new SqlParameter(PARM_PUBLISHEDVOLUME, SqlDbType.BigInt),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar,12),
                                                new SqlParameter(PARM_BOARD, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_FILTER, SqlDbType.VarChar,5),
                                                new SqlParameter(PARM_PORTCLIENTFLAG, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_FILTER2, SqlDbType.VarChar,5),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = tradeId;
                parms[4].Value = orderNumber;
                parms[5].Value = clientId;
                parms[6].Value = symbol;
                parms[7].Value = side;
                parms[8].Value = volume;
                parms[9].Value = publishedVolume;
                parms[10].Value = price;
                parms[11].Value = board;
                parms[12].Value = filter;
                parms[13].Value = portClientFlag;
                parms[14].Value = filter2;
                parms[15].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertNewConditionedOrder", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertOrderConfirmation(string timestamp, string messagetype, string firm, string orderNumber, string orderEntryDate, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_ORDERNUMBER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_ORDERENTRYDATE, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = orderNumber;
                parms[4].Value = orderEntryDate;
                parms[5].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertOrderConfirmation", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertConfirmOrderChange(string timestamp, string messagetype, string firm, string orderNumber, string orderEntryDate, string clientId, string portClientFlag, long publishVolume, string price, string filter, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_ORDERNUMBER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_ORDERENTRYDATE, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_CLIENTID, SqlDbType.VarChar,10),
                                                new SqlParameter(PARM_PORTCLIENTFLAG, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_PUBLISHEDVOLUME, SqlDbType.BigInt),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_FILTER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = orderNumber;
                parms[4].Value = orderEntryDate;
                parms[5].Value = clientId;
                parms[6].Value = portClientFlag;
                parms[7].Value = publishVolume;
                parms[8].Value = price;
                parms[9].Value = filter;
                parms[10].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertConfirmOrderChange", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertDealConfirmation(string timestamp, string messagetype, string firm, string side, string orderNumber, string orderEntryDate, string filter, long volume, string price, string confirmNumber, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_SIDE, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_ORDERNUMBER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_ORDERENTRYDATE, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_FILTER, SqlDbType.VarChar,12),
                                                new SqlParameter(PARM_VOLUME, SqlDbType.BigInt),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar,12),
                                                new SqlParameter(PARM_CONFIRMNUMBER, SqlDbType.VarChar,20),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = side;
                parms[4].Value = orderNumber;
                parms[5].Value = orderEntryDate;
                parms[6].Value = filter;
                parms[7].Value = volume;
                parms[8].Value = price;
                parms[9].Value = confirmNumber;
                parms[10].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertDealConfirmation", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertPutThroughAcknowledgement(string timestamp, string messagetype, string firmBuyer, string tradeIdBuyer, string side, string ContraFirmSeller, string tradeIdSeller, string symbol, long volume, string price, string board, string confirmNumber, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRMBUYER, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_TRADEIDBUYER, SqlDbType.VarChar, 4),
                                                new SqlParameter(PARM_SIDE, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_CONTRAFIRMSELLER, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_TRADEIDSELLER, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_SYMBOL, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_VOLUME, SqlDbType.BigInt),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar,12),
                                                new SqlParameter(PARM_BOARD, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_CONFIRMNUMBER, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firmBuyer;
                parms[3].Value = tradeIdBuyer;
                parms[4].Value = side;
                parms[5].Value = ContraFirmSeller;
                parms[6].Value = tradeIdSeller;
                parms[7].Value = symbol;
                parms[8].Value = volume;
                parms[9].Value = price;
                parms[10].Value = board;
                parms[11].Value = confirmNumber;
                parms[12].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertPutThroughAcknowledgement", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertReject(string timestamp, string messagetype, string firm, string rejectReasonCode, string messageText, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_REJECTREASONCODE, SqlDbType.VarChar,2),
                                                new SqlParameter(PARM_MESSAGETEXT, SqlDbType.VarChar,234),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = rejectReasonCode;
                parms[4].Value = messageText;
                parms[5].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertReject", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertCrossDealConfirm(string timestamp, string messagetype, string firm, string orderNumberBuyer, string orderEntryDateBuyer, string orderNumberSeller, string orderEntryDateSeller, long volume, string price, string confirmNumber, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_ORDERNUMBERBUYER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_ORDERENTRYDATEBUYER, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_ORDERNUMBERSELLER, SqlDbType.VarChar,8),
                                                new SqlParameter(PARM_ORDERENTRYDATESELLER, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_VOLUME, SqlDbType.BigInt),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_CONFIRMNUMBER, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = orderNumberBuyer;
                parms[4].Value = orderEntryDateBuyer;
                parms[5].Value = orderNumberSeller;
                parms[6].Value = orderEntryDateSeller;
                parms[7].Value = volume;
                parms[8].Value = price;
                parms[9].Value = confirmNumber;
                parms[10].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertCrossDealConfirm", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertPutThroughDealConfirmation(string timestamp, string messagetype, string firm, string side, string dealId, string contraFirm, long volume, string price, string confirmNumver, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_SIDE, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_DEALID, SqlDbType.VarChar,5),
                                                new SqlParameter(PARM_CONTRAFIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_VOLUME, SqlDbType.BigInt),
                                                new SqlParameter(PARM_PRICE, SqlDbType.VarChar,12),
                                                new SqlParameter(PARM_CONFIRMNUMBER, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = side;
                parms[4].Value = dealId;
                parms[5].Value = contraFirm;
                parms[6].Value = volume;
                parms[7].Value = price;
                parms[8].Value = confirmNumver;
                parms[9].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertPutThroughDealConfirmation", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertPutThroughDealReply(string timestamp, string messagetype, string firm, string confirmNumber, string dealId, string clientIdBuyer, string replyCode, string filter, long brokerPortfolioVolBuyer, long brokerClientVolBuyer, long mutualFundVolBuyer, long brokerForeignVolBuyer, string filter2, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_CONFIRMNUMBER, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_DEALID, SqlDbType.VarChar,5),
                                                new SqlParameter(PARM_CLIENTIDBUYER, SqlDbType.VarChar,10),
                                                new SqlParameter(PARM_REPLYCODE, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_FILTER, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_BROKERPORTFOLIOVOLBUYER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_BROKERCLIENTVOLBUYER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_MUTUALFUNDVOLBUYER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_BROKERFOREIGNVOLBUYER, SqlDbType.BigInt),
                                                new SqlParameter(PARM_FILTER2, SqlDbType.VarChar,32),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = confirmNumber;
                parms[4].Value = dealId;
                parms[5].Value = clientIdBuyer;
                parms[6].Value = replyCode;
                parms[7].Value = filter;
                parms[8].Value = brokerPortfolioVolBuyer;
                parms[9].Value = brokerClientVolBuyer;
                parms[10].Value = mutualFundVolBuyer;
                parms[11].Value = brokerForeignVolBuyer;
                parms[12].Value = filter2;
                parms[13].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertPutThroughDealReply", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertDealPutThroughCancelRequest(string timestamp, string messagetype, string firm, string contraFirm, string tradeId, string confirmNumber, string symbol, string side, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_CONTRAFIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_TRADEID, SqlDbType.VarChar,4),
                                                new SqlParameter(PARM_CONFIRMNUMBER, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_SYMBOL, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_SIDE, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = contraFirm;
                parms[4].Value = tradeId;
                parms[5].Value = confirmNumber;
                parms[6].Value = symbol;
                parms[7].Value = side;
                parms[8].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertDealPutThroughCancelRequest", parms);
            }
            catch
            {
                throw;
            }
        }

        public void InsertDealCancelReply(string timestamp, string messagetype, string firm, string confirmNumber, string replyCode, int offset)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] { 
                                                new SqlParameter(PARM_TIMESTAMP, SqlDbType.VarChar, 6),
                                                new SqlParameter(PARM_MESSAGETYPE, SqlDbType.VarChar, 2),
                                                new SqlParameter(PARM_FIRM, SqlDbType.VarChar,3),
                                                new SqlParameter(PARM_CONFIRMNUMBER, SqlDbType.VarChar,6),
                                                new SqlParameter(PARM_REPLYCODE, SqlDbType.VarChar,1),
                                                new SqlParameter(PARM_OFFSET, SqlDbType.Int)};
                parms[0].Value = timestamp;
                parms[1].Value = messagetype;
                parms[2].Value = firm;
                parms[3].Value = confirmNumber;
                parms[4].Value = replyCode;
                parms[5].Value = offset;

                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "InsertDealCancelReply", parms);
            }
            catch
            {
                throw;
            }
        }

        #endregion

        #region Count IOrder Members


        public int CountOrderCancellation()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountOrderCancellation"));
            }
            catch
            {
                throw;
            }
        }

        public int CountOrderChange()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountOrderChange"));
            }
            catch
            {
                throw;
            }
        }

        public int CountAdvertisement()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountAdvertisement"));
            }
            catch
            {
                throw;
            }
        }

        public int CountOneFirmPutThroughDeal()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountOneFirmPutThroughDeal"));
            }
            catch
            {
                throw;
            }
        }

        public int CountTwoFirmPutThroughDeal()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountTwoFirmPutThroughDeal"));
            }
            catch
            {
                throw;
            }
        }

        public int CountNewConditionedOrder()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountNewConditionedOrder"));
            }
            catch
            {
                throw;
            }
        }

        public int CountOrderConfirmation()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountOrderConfirmation"));
            }
            catch
            {
                throw;
            }
        }

        public int CountConfirmOrderCancel()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountConfirmOrderCancel"));
            }
            catch
            {
                throw;
            }
        }

        public int CountConfirmOrderChange()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountConfirmOrderChange"));
            }
            catch
            {
                throw;
            }
        }

        public int CountDealConfirmation()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountDealConfirmation"));
            }
            catch
            {
                throw;
            }
        }

        public int CountPutThroughAcknowledgement()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountPutThroughAcknowledgement"));
            }
            catch
            {
                throw;
            }
        }

        public int CountReject()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountReject"));
            }
            catch
            {
                throw;
            }
        }

        public int CountCrossDealConfirm()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountCrossDealConfirm"));
            }
            catch
            {
                throw;
            }
        }

        public int CountPutThroughDealConfirmation()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountPutThroughDealConfirmation"));
            }
            catch
            {
                throw;
            }
        }

        public int CountPutThroughDealReply()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountPutThroughDealReply"));
            }
            catch
            {
                throw;
            }
        }

        public int CountDealPutThroughCancelRequest()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountDealPutThroughCancelRequest"));
            }
            catch
            {
                throw;
            }
        }

        public int CountDealCancelReply()
        {
            try
            {
                return Convert.ToInt32(SQLHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "CountDealCancelReply"));
            }
            catch
            {
                throw;
            }
        }

        #endregion

        #region Delete IOrder Members


        public void DeleteOrderCancellation()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteOrderCancellation");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteOrderChange()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteOrderChange");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteAdvertisement()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteAdvertisement");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteOneFirmPutThroughDeal()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteOneFirmPutThroughDeal");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteTwoFirmPutThroughDeal()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteTwoFirmPutThroughDeal");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteNewConditionedOrder()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteNewConditionedOrder");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteOrderConfirmation()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteOrderConfirmation");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteConfirmOrderCancel()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteConfirmOrderCancel");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteConfirmOrderChange()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteConfirmOrderChange");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteDealConfirmation()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteDealConfirmation");
            }
            catch
            {
                throw;
            }
        }


        public void DeletePutThroughAcknowledgement()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeletePutThroughAcknowledgement");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteReject()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteReject");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteCrossDealConfirm()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteCrossDealConfirm");
            }
            catch
            {
                throw;
            }
        }

        public void DeletePutThroughDealConfirmation()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeletePutThroughDealConfirmation");
            }
            catch
            {
                throw;
            }
        }

        public void DeletePutThroughDealReply()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeletePutThroughDealReply");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteDealPutThroughCancelRequest()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteDealPutThroughCancelRequest");
            }
            catch
            {
                throw;
            }
        }

        public void DeleteDealCancelReply()
        {
            try
            {
                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.StoredProcedure, "DeleteDealCancelReply");
            }
            catch
            {
                throw;
            }
        }

        #endregion

    }
}
